<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<script type="text/javascript" src="<c:url value="/static/js/jquery.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/static/js/encrypt.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/static/js/formview.js"/>"></script>
	<link rel="stylesheet" type="text/css" href="<c:url value="/static/css/css.css"/>"  />
	<script type="text/javascript" src="<c:url value="/static/layer/layer.js"/>"></script>
    <script type="text/javascript" src="<c:url value="/static/js/tool.js"/>" ></script>
  </head>
<body>
<ul class=tab_nav>
  <li>
     <a href="/qh/public/common/r.htmls?page=abc/user/advertiser_edit&naviId=45">账号中心</a>
  </li>
  <li>
     <a href="/qh/public/common/r.htmls?page=abc/log/task_operlog_list&naviId=45">操作日志</a>
  </li>
  <li>
     <a class="current" href="javascript:void(0)">通知</a>
  </li>
  <li>
     <a href="/qh/public/common/r.htmls?page=abc/home/modpassword&naviId=49">修改密码</a>
  </li>
</ul>
<div class="contrainer">
<div class="notice_type">
   <select id="selType">
      <option value="">全部消息</option>
      <option value="系统消息">系统消息</option>
      <option value="账户消息">账户消息</option>
      <option value="财务消息">财务消息</option>
   </select>
</div>
<div>
   <ul class="notice_ul">
      <li>
         <a href="#">
            <div class="title">
               <span class="time">01/10/2017</span>
               钱狐系统中心
            </div>
            <div class="type">系统消息</div>
            <div class="content">
               外链电商3C-手机行业强制使用枫叶落地页通知，外链电商3C-手机行业强制使用枫叶落地页通知，外链电商3C-手机行业强制使用枫叶……
            </div>
         </a>
      </li>
      <li>
               <a href="#">
                  <div class="title">
                     <span class="time">01/10/2017</span>
                     钱狐系统中心
                  </div>
                  <div class="type">系统消息</div>
                  <div class="content">
                     外链电商3C-手机行业强制使用枫叶落地页通知，外链电商3C-手机行业强制使用枫叶落地页通知，外链电商3C-手机行业强制使用枫叶……
                  </div>
               </a>
      </li>
   </ul>
   <iframe name='noticeFrame' id="noticeFrame" src="" frameborder="0" style="width:100%;overflow:auto;float:right" ></iframe>
</div>
</div>
<script>
   $(function(){
       loadData("");

       $("#selType").change(function(){
           loadData($("#selType").val());
       });

       var h=$(window).height()-82-30;
       var w=$(window).width()-410;
       $("#noticeFrame").width(w);
       $("#noticeFrame").height(h);
       $(".notice_ul").height(h);

   });
   function loadData(type){
      $.getJSON("${pageContext.request.contextPath}/public/common/getNoticeList.htmls",{type:type},function(data){
                var html="";
                $.each(data,function(i,item){
                   if(i==0){
                      rid(item.id);
                   }
                   var createDateTime=new Date(item.createDateTime);
                   createDateTime=createDateTime.Format("dd/MM/yyyy");
                   var note=clearHtml(item.note);
                   note=note.length>50?note.substring(0,50)+"...":note;
                   html+="<li>";
                   html+="<a onclick='rid("+item.id+")' href='javascript:void(0)' >";
                   html+="<div class='title'>";
                   html+="<span class='time'>"+createDateTime+"</span>";
                   html+=item.title;
                   html+="</div>";
                   html+="<div class='type'>"+item.type+"</div>";
                   html+="<div class='content'>";
                   html+=note;
                   html+="</div>";
                   html+="</a>";
                   html+="</li>";
                });
                $(".notice_ul").html(html);
             });
   }

   function rid(id){
      $('#noticeFrame').attr('src',"/qh/public/common/r2.htmls?page=adver/notice_view&id="+id);
   }
</script>
</body>
</html>
